{extend name="layout/layout" /}

{block name="pagecss"}
<link href="__STATIC__/plugins/layui/css/layui.css?v={:date('ymd')}" rel="stylesheet" type="text/css" />
<style>
	.container
	{
		width:100%;
		height:100%;
		overflow:scroll;
	}
	.zhushi {color:#ccc;font-size:15px;}

	.defaultImage {
		position: relative;
	}
	.center-success {
		position:absolute;
		top:-1.5rem;
		height: 30px;
		margin-left: -7.5rem;
		line-height:5rem;
	}

	.uploaderCon {
		border: dashed 2px #ccc;
		width: 100px;
		height: 100px;
		float: left;
		display: flex;
		justify-content: center;
		align-items: center;
		flex-direction: column;
		cursor: pointer;
	}
	.uploaderCon .icon0 {
		font-size: 40px;
		color: #999999;
	}
	label{
		height: 40px;
	}
</style>
{/block}

{block name="content"}
<div class="row">
	<div class="col-xs-12">
		<div class="box box-success">
			<div class="box-header with-border">
				<h3 class="box-title">新增会员类型</h3>
				<div class="box-tools">
					<!--<button class="btn bg-navy btn-sm" data-toggle="tooltip" title="" data-original-title="Back" onclick="history.go(-1);">
                        <i class="fa fa-reply"></i> 返回
                    </button>-->
				</div>
			</div>
			<div class="box-body">
				<form id="modal_new_role" class="form-horizontal form validation-form" method="post" enctype="multipart/form-data">
					{:token()}
					<div class="form-body">
						<div class="row">
							<div class="form-group ">
								<label class="col-lg-2 col-xs-4 control-label">
									<span class="required"> * </span>会员类型名称：
								</label>
								<div class="form-inline ">
									<input id="memType" class="form-control" style="width: 450px;" value="" type="text" name="memType" maxlength="12"/>
								</div>
							</div>
						</div>

						<div class="row">
							<div class="form-group">
								<label class="col-lg-2 col-xs-4 control-label">
									<span class="required">*</span>会员卡：
								</label>
								<div class="form-inline">
									<div >
										<span>
										<input class="selectImg" id="selectImg"  value="" type="hidden" checked name="selectImg"/>

										<input class="is_img" value="1" checked type="radio" name="is_img"/>
										<span class="margin-left">
											选择图案
										</span>
										&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
										<input class="is_img" value="0" type="radio" name="is_img"/>
										<span class="margin-left">
											自定义图案
											<span class="zhushi">建议尺寸750像素×400像素，大小不超过500kb</span>
										</span>
									</span>
									</div>
									<div  style="margin-top: 10px">
										<div id="topMemberType" >
											{volist name="memberDefultImageList" id="vo"}
											<span class="defaultImage">
										<span class="margin-left imgUrl">
											<img class="" style="width: 120px;height: 80px;" data-image-id="{$vo.id}" src="{$vo.imgUrl}">
										</span>
									</span>
											{/volist}
										</div>
									</div>
									<div >
										<div id="btn-uploader"  style="display: none;">
									<span class="defaultImage" style="float: left;">

									</span>
											<div id="uploader">
												<div  class="uploaderCon" data-toggle="modal" data-target="#uploaderBox">
													<span class="icon0">+</span>
													<small class="color9">上传图片</small>
												</div>
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>

						<div class="row">
							<div class="form-group ">
								<label class="col-lg-2 col-xs-4 control-label">
									<span class="required">*</span> 开通条件：
								</label>
								<div class="form-inline" >
									<input class="openStatus" value="1" checked type="radio" name="openStatus"/>
									<span class="margin-left">
										充值开通
									</span>
								</div>
								<div class="form-inline" style="margin-top: 10px">
									<span class="zhushi">充值金额</span>
									<input class="form-control openCondition margin-left" id="rechargeOpenMoney" style="width: 100px"  value="" type="text" name="rechargeOpenMoney"/>

									<span class="margin-left">元</span>
									<span class="zhushi">账户返还</span>
									<input class="form-control openCondition margin-left" id="returnMoney" style="width: 100px"  value="" type="text" name="returnMoney"/>

									<span class="margin-left">元</span>
									<span class="zhushi">赠送积分</span>
									<input class="form-control openCondition margin-left" id="rechargeIntegral" style="width: 100px"  value="" type="text" name="rechargeIntegral"/>
								</div>
								<label class="col-lg-2 col-xs-4 control-label"> <span></span> </label>
								<div class="form-inline" style="margin-top: 10px">
									<input class="openStatus" value="2" type="radio" name="openStatus"/>
									<span class="margin-left">无条件</span>
								</div>
							</div>
						</div>

						<div class="row">
							<div class="form-group ">
								<label class="col-lg-2 col-xs-4 control-label">
									<span class="required">*</span>会员期限：
								</label>
								<div class="form-inline">
									<input class="endTime" value="0" checked type="radio" name="isIndefinite"/>
									<span class="margin-left">无期限</span>
									<span class="margin-left">
										<input  class="endTime" value="1" type="radio" name="isIndefinite"/>
										<span class="margin-left">
											有期限
										</span>
									</span>
									<span>
										<input  class="term form-control" style="width: 50px" value="" type="text" name="term"/>
										<select class="form-control years" name="timetype">
											<option value="1">年</option>
											<option value="2">月</option>
										</select>
										<span class="form-control-static zhushi margin-right">到期后重新开通</span>
									</span>
								</div>
							</div>
						</div>

						<div class="row">
							<div class="form-group ">
								<label class="col-lg-2 col-xs-4 control-label">
									<span class="required">*</span>会员权益：
								</label>
								<div class="form-inline">
									<input class="img"  value="0" type="radio" checked name="isMemBerShop"/><span>享受会员价购物</span><span class="margin-left zhushi">不与代金券同时使用</span>
								</div>

								<div class="form-inline" style="margin-top: 10px">
									<input class="memEquilties"  value="1" type="radio" name="isMemBerShop"/>
									<span>享受会员</span>
									<span class="margin-left">
										<input class="form-control" id="memberDiscounts" value="" style="width: 100px" type="text" name="memberDiscounts">
										<span class="margin-left">折买单
										<span class="margin-left zhushi">不与代金券同时使用</span>
										</span>
									</span>
								</div>
							</div>
						</div>

						<div class="row">
							<div class="form-group ">
								<label class="col-lg-2 col-xs-4 control-label">
									会员积分：
								</label>
								<div class="form-inline">
									<input class="img"  value="1" type="checkbox" checked name="tempPointStatus"/>
									<span class="margin-left">
										消费积分
										<span class="margin-left zhushi">
											完成订单消费可获积分
										</span>
									</span>
								</div>

								<div class="form-inline" style="margin-top: 10px">
									<span>
										单笔消费满
										<span class="margin-left">
											<input class="integralMoney form-control" id="consumeMoney" style="width: 100px" value="" type="text" name="consumeMoney"/>
											<span class="margin-left">
												元
												<span class="margin-left">
													送
													<input class="margin-left integralMoney form-control" id="consumeIntegral" style="width: 100px" value="" type="text" name="consumeIntegral"/>&nbsp;&nbsp;积分
														</span>
												</span>
											</span>
										</span>
									</span>
								</div>
							</div>
						</div>

						<input type="hidden" name="tenantId" value="{$TENANT_ID}">
						<hr />

						<div class="form-actions">
							<div class="row">
								<div class="col-md-12">
									<div class="form-group">
										<label class="col-md-3 control-label"></label>
										<div class="col-md-9">
											<button type="button" class="btn btn-primary" id="save">
												保存 <i class="fa fa-floppy-o"></i>
											</button>
											<button type="button" class="btn btn-default" onclick="history.go(-1);">
												返回 <i class="fa fa-mail-forward"></i>
											</button>
											<div class="help-block " style="color:red"></div>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>
{/block}

{block name="pagescript"}
<script>
    var index_url = "{:url('admin/Membertype/index')}";
    var add_url = "{:url('admin/Membertype/add')}";
</script>
<script src="__STATIC__/admin/js/include.js" type="text/javascript"></script>
<script src="__STATIC__/admin/pages/js/memberType.js?v={:time()}" type="text/javascript"></script>
{/block}